import { getColumnsData } from "../common";

const shopListTable = [
  {
    title: "飞力仕弹力健身棒 飞力仕多功能训练棒",
    image:
      "https://cbu01.alicdn.com/img/ibank/O1CN01EcsRb52860Y9I9skT_!!2214032417882-0-cib.jpg", // 商品图
    price: "100.000", //售价
    luckey_coin_price: "100.00", // 幸运币售价
    type_text: "休闲娱乐", // 所在分类
    status: false, // 状态 1: 启用 2: 停用
    sort: 1 // 排序
  }
];

const headerList = [
  {
    width: "100px",
    label: "编号",
    prop: "id",
    sortable: true
  },
  {
    width: "auto",
    minWidth: "380px",
    label: "标题",
    prop: "title"
  },
  {
    width: "auto",
    label: "图片",
    prop: "image",
    showValue: [
      {
        style: "width: 30px; height: 30px",
        class: "cursor-pointer",
        key: "image",
        cellType: "image",
        tableType: "shopList" // 表格类型,用于点击事件时,区分是哪个表格的按钮
      }
    ]
  },
  {
    width: "auto",
    label: "售价",
    prop: "price"
  },
  {
    label: "幸运币售价",
    prop: "luckey_coin_price"
  },
  {
    label: "所在分类",
    prop: "type_text"
  },
  {
    label: "状态",
    prop: "status",
    showValue: [
      {
        class: "",
        key: "status",
        cellType: "switch",
        tableType: "shopList" // 表格类型,用于点击事件时,区分是哪个表格的按钮
      }
    ]
  },
  {
    label: "排序",
    prop: "sort"
  },
  {
    label: "操作",
    width: "180px",
    hideCheck: true,
    fixed: "right",
    showValue: [
      {
        class: "",
        key: "编辑",
        cellType: "button",
        type: "primary", // 按钮类型
        buttonType: "edit",
        tableType: "shopList" // 表格类型,用于点击事件时,区分是哪个表格的按钮
      },
      {
        class: "",
        key: "删除",
        cellType: "button",
        type: "danger", // 按钮类型
        buttonType: "delete",
        tableType: "shopList" // 表格类型,用于点击事件时,区分是哪个表格的按钮
      }
    ]
  }
];

const shopListColumns = [];

getColumnsData("shopList", shopListColumns, headerList, res => {
  console.log("shopList", res);
});
export { shopListTable, shopListColumns };
